import request from '@/utils/request'


/**
 * 查询物资产品
 * @param {}} current 
 * @param {*} size 
 * @param {*} productVO 
 * @returns 
 */
export function getProductList(current,size,productVO){
    return request({
        url: '/biz/product/getProductList',
        method: 'post',
        params:{
            current,
            size
        },
        data:productVO
    })
}

/**
 * 添加物资
 * @param {} product 
 * @returns 
 */
export function addProduct(product){
    return request({
        url: '/biz/product/addProduct',
        method: 'post',
        data: product
    })
}

/**
 * 恢复物资
 * @param {} id 
 * @returns 
 */
export function back(id){
    return request({
        url: '/biz/product/backProduct',
        method: 'post',
        params: {
            id
        }
    })
}

/**
 * 删除物资
 * @param {} id 
 */
export function del(id){
    return request({
        url : '/biz/product/delProduct',
        method: 'delete',
        params:{        
            id
        }
    })
}

/**
 * 移至回收站
 * @param {} id 
 * @returns 
 */
export function remove(id){
    return request({
        url: '/biz/product/removeProduct',
        method: 'post',
        params: {
            id
        }
    })
}

/**
 * 审核通过
 * @param {} id 
 * @returns 
 */
export function publish(id){
    return request({
        url: '/biz/product/publishProduct',
        method: 'post',
        params: {
            id
        }
    })
}

/**
 * 修改物资
 * @param {} product 
 * @returns 
 */
export function updateProduct(product){
    return request({
        url : '/biz/product/updateProduct',
        method: 'post',
        data: product,
    })
}

/**
 * 发放物资
 * @returns 
 */
export function findOutEnableStocks(current,size,productVO){
    return request({
        url: '/biz/product/findOutEnableStocks',
        method: 'post',
        /*localhost:8080/user?id=  方式传值*/
        params: {
        current,
        size
        },
        /*json数据传值*/
        data: productVO
    })
}

/**
 * 查询物资库存
 * @param {*} current 
 * @param {*} size 
 * @param {*} productVO 
 * @returns 
 */
export function findProductStocks(current,size,productVO){
    return request({
        url: '/biz/product/findProductStocks',
        method: 'post',
        params: {
            current,
            size
        },
        data: productVO
    })
}

